<?PHP
require_once "../../../../mainfile.php";
require_once(XOOPS_ROOT_PATH."/include/fckeditor/fckeditor.php") ;
?>

<div id="top_bar" style="background-color:#436792; height:15px; margin: 8px 0px 0 0px;">&nbsp;</div>

<table cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td style="background-color:#b8b4ae;width: 200px;margin-left:0px;">
		
			<!-- ######### TOOLBAR ##########-->
			<div id="toolbar1" dojoType="dijit.Toolbar">
				<div dojoType="dijit.form.Button" id="newCategory" iconClass="dijitEditorIcon dijitEditorIconSave" showLabel="false" onClick="dijit.byId('newCategoryDialog').show();dojo.byId('newCategoryText').focus();"></div>				
         		<!-- <span dojoType="dijit.ToolbarSeparator"></span> -->
		   </div>
		   
		   
		   <!-- ######### TOOL TIPS ##########-->
		   <div dojoType="dijit.Tooltip" connectId="newCategory" label="Create a new content category"></div>
		   
		   
		   
		   <!-- ######### NEW CATEGORY DIALOG ##########-->
	         <div dojoType="dijit.Dialog" style="width:315px;" id="newCategoryDialog" title="Add a New Content Category" refreshOnShow="true">
				    <table>
				        <tr>
					        <td><label for="newCategoryText">New category:</label></td>
					        <td><input type="text" id="newCategoryText" name="newCategoryText" value="" dojoType="dijit.form.TextBox"  trim="true" uppercase="true"/></td>
				        </tr>
				        <tr>
			                <td colspan="2" align="center" style="padding-top:10px;">
			                <button dojoType=dijit.form.Button type="submit" onClick="submitAddNewCategoryForm();">Add New Category</button></td>
				        </tr>
				    </table>
			</div>
		   

		   <!-- ######### RENAME DIALOG ##########-->
	         <div dojoType="dijit.Dialog" style="width:225px;" id="renameDialog" title="Rename Menu Item" execute="" refreshOnShow="true">
				    <table>
				        <tr>
					        <td><label for="renameMenuItem">Rename <span id="renameTitleHolder" style="text-decoration:underline"></span>	to:</label></td>
				        </tr>	
				        <tr>				        				        
					        <td><input type="text" id="renameMenuItem" name="renameMenuItem" value="" dojoType="dijit.form.TextBox"  trim="true" propercase="true"/></td>
				        </tr>
				        <tr>
			                <td align="center" style="padding-top:10px;">
			                <button dojoType=dijit.form.Button type="button" onClick="submitRenameMenuItem();">Rename</button></td>
				        </tr>
				    </table>
			</div>  

		   <!-- ######### DELETE CONTENT DIALOG ##########-->
	         <div dojoType="dijit.Dialog" style="width:240px;" id="deletDialog" title="Delete Menu Item" execute="" refreshOnShow="true">
				    <table>
				        <tr>
					        <td>Are you sure you want to delete <br /><span id="deleteContentTitleHolder" style="text-decoration:underline"></span>?</td>
				        </tr>	
				        <tr>
			                <td align="center" style="padding-top:10px;">
			                <button dojoType=dijit.form.Button type="button" onClick="submitDeleteMenuItem();">Yes</button> &nbsp; &nbsp; <button dojoType=dijit.form.Button type="button" onClick="dijit.byId('deletDialog').hide();">Cancel</button></td>
				        </tr>
				    </table>
			</div>  
			
		   <!-- ######### DELETE CATEGORY DIALOG ##########-->
	         <div dojoType="dijit.Dialog" style="width:240px;" id="deleteCategoryDialog" title="Delete Category Item" execute="" refreshOnShow="true">
				    <table>
				        <tr>
					        <td>Are you sure you want to delete the <span id="deleteCategoryTitleHolder" style="text-decoration:underline"></span> category <b><u>and all of it's content?</u></b></td>
				        </tr>	
				        <tr>
			                <td align="center" style="padding-top:10px;">
			                <button dojoType=dijit.form.Button type="button" onClick="submitDeleteMenuItem();">Yes</button> &nbsp; &nbsp; <button dojoType=dijit.form.Button type="button" onClick="dijit.byId('deleteCategoryDialog').hide();">Cancel</button></td>
				        </tr>
				    </table>
			</div> 			


			
			<!-- ######### RIGHT CLICK MENU ##########-->
			<div dojotype="dijit.Menu" id="tree_menu" style="display: none; width:110px; text-align:left;">
				<div id="menuView" dojotype="dijit.MenuItem" onclick="view();">View</div>
				<div id="menuRename" dojotype="dijit.MenuItem" onclick="rename();">Rename</div>
				<div id="menuDelete" dojotype="dijit.MenuItem" iconclass="dijitEditorIcon dijitEditorIconDelete" onclick="deleteItem();">Delete</div>
				<div id="menuCut" dojotype="dijit.MenuItem" iconclass="dijitEditorIcon dijitEditorIconCut" onclick="cut();">Cut</div>
				<div id="menuCopy" dojotype="dijit.MenuItem" iconclass="dijitEditorIcon dijitEditorIconCopy" onclick="copy();">Copy</div>
				<div id="menuPaste" dojotype="dijit.MenuItem" iconclass="dijitEditorIcon dijitEditorIconPaste" onclick="paste();">Paste</div>
			</div>
			

					   
		   
		   <!-- ######### CREATE THE MENU TREE ON LEFT SIDE ##########-->
			<div preload="true" id="menuContentPane" href="includes/menu_tree_html.php" dojoType="dijit.layout.ContentPane" preventCache="true"></div>
          
		</td>
		
		<td style="background-color:#e7e7e7;padding-left:4px;">
		
				<!-- ########## MAIN CONTENT FORM ##########-->
				<form dojoType="dijit.form.Form" name="contentForm" id="contentForm"  method="post" style="padding-bottom:4px; margin:0;" onKeyPress="return event.keyCode != 13">
				
				<table style="margin-top:5px;margin-bottom:5px;">
					<tr>
						<td style="font-weight:600;width:40px;">Title:</td>
						<td style="width:225px;"><input type="text" id="title" name="title" value="" dojoType="dijit.form.TextBox" trim="true" propercase="true"/></td>
						<td style="font-weight:600;width:75px;">Category:</td>
						<td style="width:240px;">
							<div preload="true" id="dropDownContentPane" href="includes/dropDownCategoriesHtml.php" dojoType="dijit.layout.ContentPane" preventCache="true">		
		            		</div>
						</td>
						
						<td><div id="systemMessages" dojoType="dijit.TitlePane" duration="250" title="System Messages:" open="false"></div></td>
					</tr>
				</table>
				
				<input id="editID" name="editID" type="hidden" dojoType="dijit.form.TextBox" value="" />
				<input id="FCKBody" name="FCKBody" type="hidden" dojoType="dijit.form.TextBox" value="" required="true" />

		
				<?php 
				$basePath = XOOPS_URL."/include/fckeditor/" ;
				$oFCKeditor = new FCKeditor('body') ;
				$oFCKeditor->BasePath	= $basePath ;
				$oFCKeditor->Config['SkinPath'] = $basePath . 'editor/skins/office2003/' ;
				$oFCKeditor->ToolbarSet = 'CoastAlaska';
				$oFCKeditor->Height	= 340 ;
				//$oFCKeditor->Width = 600 ;
				$oFCKeditor->Value		= '' ;
				$oFCKeditor->Create() ;
				?>
			<br>
			<button dojoType="dijit.form.Button" onClick="ExecuteCommand('Preview');" >Preview</button> <button dojoType="dijit.form.Button" onClick="submitContentForm();" >Save</button> <button dojoType="dijit.form.Button" onClick="clearContentForm();">Clear Form</button>
		</form>    
    
		</td>
	</tr>
</table> 

